#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;
const int MX = 1e5;

int n, m;
struct Line {
  double l, r, h;
  int op;
  bool operator<(const Line& o) const { return h < o.h; }
} a[N];
double b[N];
int num;
double sum[N << 2];
int tag[N << 2];
void pushup(int p, int l, int r) {
  if (tag[p])
    sum[p] = b[r] - b[l];
  else if (r == l + 1)
    sum[p] = 0;
  else
    sum[p] = sum[p << 1] + sum[p << 1 | 1];
}
void addtag(int d, int p, int l, int r) {
  tag[p] += d;
  pushup(p, l, r);
}
void update(int L, int R, int d, int p, int l, int r) {
  if (L <= l && R >= r) {
    addtag(d, p, l, r);
    return;
  }
  int mid = (l + r) >> 1;
  if (L < mid) update(L, R, d, p << 1, l, mid);
  if (R > mid) update(L, R, d, p << 1 | 1, mid, r);
  pushup(p, l, r);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int id = 0;
  while (cin >> n && n) {
    id++;
    cout << "Test case #" << id << endl;
    cout << "Total explored area: ";
    double x1, y1, x2, y2;
    rep(i, 1, n) {
      cin >> x1 >> y1 >> x2 >> y2;
      if (x1 > x2) swap(x1, x2);
      if (y1 > y2) swap(y1, y2);
      a[i] = {x1, x2, y1, 1};
      a[i + n] = {x1, x2, y2, -1};
      b[i] = x1, b[i + n] = x2;
    }
    sort(b + 1, b + n * 2 + 1);
    num = unique(b + 1, b + n * 2 + 1) - b - 1;
    sort(a + 1, a + n * 2 + 1);
    double w = 0, h = 0;
    double area = 0;
    rep(i, 1, n * 2) {
      area += 1ll * w * (a[i].h - h);
      int L = lower_bound(b + 1, b + num + 1, a[i].l) - b;
      int R = lower_bound(b + 1, b + num + 1, a[i].r) - b;
      update(L, R, a[i].op, 1, 1, MX);
      w = sum[1], h = a[i].h;
    }
    cout << fixed << setprecision(2) << area << endl << endl;
  }
  return 0;
}